package com.epam.client;

import java.io.IOException;

import com.epam.client.backingbeans.BillsManageBean;
import com.epam.client.backingbeans.ClientRegisterBean;
import com.epam.client.backingbeans.ClosedRequestBean;
import com.epam.client.backingbeans.NewRequestBean;

@SuppressWarnings("unused")
public class ClientController {

	
	private BillsManageBean billsManageBean;
	private ClientRegisterBean clientRegisterBean;
	private ClosedRequestBean closedRequestBean;
	private NewRequestBean newReqestBean;

	// BillsManageBean
	public String payBill() {
		// Request request = bill.getRequest();
		// request.setStatus(Status.ACTIVE);
		// requestDAO.update(request);
		//
		// bill.setStatus(Status.PAYED);
		// billDAO.update(bill);
		return null;
	}

	// ClientLoginBean
	public String login() {
		// log.debug("tried to check login" + " " + login + " " + pass);
		//
		// Client client = clientDAO.read(login, pass);
		//
		// if (client != null) {
		// log.debug("login success");
		// JsfUtil.createSession();
		// JsfUtil.setAttribute("client", client);
		// return "success";
		// } else {
		// JsfUtil.addMessage("login_register_form:login",
		// "Wrong login or password");
		// log.debug("login fail");
		// return "fail";
		// }
		return null;
	}

	public String logout() throws IOException {
		// log.debug("tried to logout");
		//
		// FacesContext context = FacesContext.getCurrentInstance();
		// HttpServletRequest request = (HttpServletRequest) context
		// .getExternalContext().getRequest();
		// request.getSession().invalidate();
		//
		// HttpServletResponse response = (HttpServletResponse) FacesContext
		// .getCurrentInstance().getExternalContext().getResponse();
		// response.sendRedirect("faces/index.xhtml");
		return null;
	}

	// ClientRegisterBean
	public String register() {
		// TODO
		return null;
	}

	// ClosedRequestBean

	// NewRequestBean
	public String createRequest() {
		//
		// Client client = (Client) JsfUtil.getAttribute("client");
		//
		// car.setIsAvaliable(false);
		// carDAO.update(car);
		//
		// request.setClient(client);
		// request.setCar(car);
		// request.setStatus(Status.NEW);
		// requestDAO.create(request);
		//
		// JsfUtil.addMessage("new_request_form:beginDate",
		// "Request successfully created");
		//
		// return "success";
		return null;
	}
	
	//new
	public String cancelCarRequest(){
		return null;
	}
	
	public String editRequest(){
		return null;
	}
	
}
